﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cricket.LinqModel
{
    public partial class Team
    {
        private IDataRepository _dataObject;
        public Team(IDataRepository dataObject)
            : this()
        {
            _dataObject = dataObject;
        }
        public void Create()
        {
            _dataObject.CreateTeam(this);
        }
        public List<Team> GetAllTeam()
        {
            return _dataObject.GetAllTeam();
        }
        public void DeleteTeam()
        {
            _dataObject.DeleteTeam(this);
        }
        public void GetTeamById()
        {
            _dataObject.GetTeamById(this);
        }
        public void UpdateTeam()
        {
            _dataObject.UpdateTeam(this);
        }
        public List<Team> CheckTeamNameExist(int TeamId, string teamName)
        {
            return _dataObject.CheckTeamNameExist(TeamId, teamName);
        }
        public List<Team> CheckAbbrivationExist(int TeamId, string abbrivation)
        {
            return _dataObject.CheckAbbrivationExist(TeamId, abbrivation);
        }
        public List<Team> GetTeamsBySeriesId(int SeriesId)
        {
            return _dataObject.GetTeamsBySeriesId(SeriesId);
        }
        public List<GetAllTeamsResult> GetAllTeams()
        {
            return _dataObject.GetAllTeams();
        }
    }
}
